{include file='common/header'}
{include file='common/menu'}

<!-- Page Content -->
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="#">系统</a>
            </li>
            <li class="active">权限列表</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->

    <!-- Page Body -->
    <div class="page-body">

        <button type="button" tooltip="添加权限" class="btn btn-sm btn-azure btn-addon"
                onClick="javascript:window.location.href = '{:url(\'auth_rule/add\')}'"><i class="fa fa-plus"></i> Add
        </button>
        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget">
                    <div class="widget-body">
                        <div class="flip-scroll">
                            <form action="" method="post">
                            <table class="table table-bordered table-hover">
                                <thead class="">
                                <tr>
                                    <th class="text-center" style="width: 10%">ID</th>
                                    <th class="text-center" style="width: 10%">排序</th>
                                    <th class="text-center" style="width: 20%">权限名称</th>
                                    <th class="text-center" style="width: 20%">控制器/方法</th>
                                    <th class="text-center" style="width: 20%">级别</th>
                                    <th class="text-center" style="width: 20%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="auth_rules" id="auth_rule"}
                                <tr>
                                    <td align="center">{$auth_rule.id}</td>
                                    <td align="center"><input style="width: 50px; text-align: center" type="text" name="{$auth_rule.id}" value="{$auth_rule.sort}" required="required" maxlength="3"></td>
                                    <td align="left">{if condition="$auth_rule['level'] neq 0"}|{/if}<?php echo str_repeat('-----', $auth_rule['level']) ?>{$auth_rule.title}</td>
                                    <td align="left"><?= mb_substr($auth_rule['name'], 0, 20, 'utf-8'); if(mb_strlen($auth_rule['name'], 'utf-8')>20) {echo '...';};?></td>
                                    <td align="left">{$auth_rule['level']+1}级</td>
                                    <td align="center">
                                        <a href="{:url('auth_rule/edit', array('id'=>$auth_rule['id']))}" class="btn btn-primary btn-sm shiny">
                                            <i class="fa fa-edit"></i> 编辑
                                        </a>
                                        <a href="#" onClick="warning('确实要删除该权限吗', '{:url(\'auth_rule/del\', array(\'id\'=>$auth_rule[\'id\']))}')"
                                           class="btn btn-danger btn-sm shiny">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </a>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                                <div style="margin-top: 10px;float: left"><input type="submit" class="btn btn-primary" value="排序"></div>
                                <div class="clear"></div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- /Page Body -->
</div>
<!-- /Page Content -->

{include file='common/footer'}
